<template lang="html">
  <div class="container">
    <home-header></home-header>   <!--  展示引入的header组件 -->
    <div class="content">
      <ul class="cont-ul">
          <!-- list组件展示区，并用v-for来将数据遍历，:xx="xxx" 是用来给子组件传递数据的 -->
        <list v-for="item in items" :price="item.price" :title="item.title" :img="item.img"></list>
      </ul>
    </div>
    <common-footer></common-footer>  <!--  展示引入的footer组件 -->
  </div>
</template>

<script>
  import Vue from 'vue'
  import head from '@/components/HomeHead'
  import body from '@/components/HomeBody'
  import footer from '@/components/HomeFooter'
  export default {
    data() {
      return {obj: [],items:[]}
    }, components: {
      head,body,footer
    }, mounted() {
      var _this = this;
console.log(1);
    },created(){
      this.axios.get('../../static/data.json').then((data)=>{
        this.items=data.data.goods;
      })
    }
  }
</script>
<style lang="css" scoped>
  .container {
    width: 100%;
    margin: 0 auto;
  }
  .content {
    margin-bottom: 1.8rem;
  }
  .cont-ul {
    padding-top: 0.5rem;
    background-color: #ccc;
  }
  .cont-ul::after {
    content: '';
    display: block;
    clear: both;
    width: 0;
    height: 0;
  }
</style>
